/*
 * Copyright © Jack魏 2022 - 2022, All Rights Reserved.
 */

package com.jack.thread.t02;

/**
 * 守护线程演示
 *
 * @author Jack魏
 * @since 2022/11/19 23:08
 */
public class DaemonThread {
    private static class MyRunnable implements Runnable {
        @Override
        public void run() {
            System.out.println("While running");
        }
    }

    public static void main(String[] args) {
        Thread thread = new Thread(new MyRunnable());
        // 主线程执行完，此线程也就消亡了
        thread.setDaemon(true);
        thread.start();
    }
}
